<template>
  <div id="rose-chart">
    <div id="digital">
        <div class="digital-flop-item">
        <div class="digital-flop-title" style="color: white;">{{ total.title }}</div>
        <div class="digital-flop">
            <dv-digital-flop
              :config="total.number"
              style="width:100px;height:60px;"/>
            <div class="unit" style="color: white;">{{ total.unit }}</div>
        </div>
    </div>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
import Rankingbottom from './Rankingbottom'
export default {
  name: 'RoseChart',
  components: {
    Rankingbottom
  },
  computed: {
    ...mapState({
      allCount: state => state.Consumpt.allCount,
    })
  },
  data () {
    return {
      total: {}
    }
  },
    methods: {
    createData () {
      this.total = {
          title: '订单总金额',
          number: {
            number: [this.allCount],
            content: '{nt}',
            textAlign: 'right',
            style: {
              fill: '#4d99fc',
              fontWeight: 'bold'
            }
          },
          unit: '元'
        }
    },
  },
  mounted () {
    const { createData } = this

    createData()

    setInterval(createData, 30000)
  }
}
</script>

<style lang="scss">
#rose-chart {
  width: 100%;
  height: 30%;
  background-color: rgba(6, 30, 93, 0.5);
  border-top: 2px solid rgba(1, 153, 209, .5);
  box-sizing: border-box;
  overflow: hidden;

  .rose-chart-title {
    color: white;
    height: 50px;
    text-indent: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
  }

  .dv-charts-container {
    height: 280px;
  }
}
#digital {
  position: relative;
  height: 34%;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0,0,0,0);

  .dv-decoration-10 {
    position: absolute;
    width: 95%;
    left: 2.5%;
    height: 5px;
    bottom: 0px;
  }

  .digital-flop-item {
    width: 100%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: -100px;
  }

  .digital-flop-title {
    font-size: 20px;
    margin-bottom: 0px;
  }

  .digital-flop {
    display: flex;
  }

  .unit {
    margin-left: 10px;
    display: flex;
    align-items: flex-end;
    box-sizing: border-box;
    padding-bottom: 13px;
  }
}
</style>
